const http = require("http");
const portMaps = require('./data.ts')
const PORT = 4000;
http
  .createServer(function ({ method, url }, res) {

    console.log(method, url);
    console.log(portMaps[`${method} /api${url}`])
    console.log(typeof portMaps[`${method} /api${url}`])
    res.writeHead(200, { 'Content-Type': 'application/json' });
    res.end(
      JSON.stringify(portMaps[`${method} /api${url}`])
    );
  })
  .listen(PORT, () => {
    console.log('mock...', PORT)
  });

